package com.example.hms.util;

public class ResultSubmit {
    public static Result success(Object data){
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage("操作成功");
        System.out.println("当前调用的是成功方法-01");
        return result;
    }

    public static Result success(Object data,String message){
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage(message);
        System.out.println("当前调用的是成功方法-02");
        return result;
    }

    public static Result error(String message){
        Result result = new Result();
        result.setCode(-1);
        result.setMessage(message);
        return result;
    }

    public static Result fail(){
        Result result = new Result();
        result.setCode(-1);
        result.setMessage("服务器错误，请联系运维人员");
        return result;
    }
}
